﻿using System;

namespace EventLogAnalyzer.ViewModel.XAxisInclusionStrategies
{
    public class TimeBasedStrategy : IXAxisInclusionStrategy
    {
        private readonly DateTime _startTimeStamp;
        private readonly DateTime _endTimeStamp;

        public TimeBasedStrategy(DateTime startTimeStamp, DateTime endTimeStamp)
        {
            this._startTimeStamp = startTimeStamp;
            this._endTimeStamp = endTimeStamp;
        }

        public bool DoesLogBelongHere(EventLogViewModel log)
        {
            return log.TimeStamp >= _startTimeStamp && log.TimeStamp < _endTimeStamp;
        }
    }
}